using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;

namespace SAKS.Models
{
    public partial class User : Entity
    {
        #region Primitive Properties
        


        public virtual string UserName
        {
            get;
            set;
        }
    
        public virtual string LoweredUserName
        {
            get;
            set;
        }
    
        public virtual string MobileAlias
        {
            get;
            set;
        }
    
        public virtual bool IsAnonymous
        {
            get;
            set;
        }
    
        public virtual System.DateTime? LastActivityDate
        {
            get;
            set;
        }

        #endregion

        #region Navigation Properties

        public virtual ICollection<Role> Roles{get;set;}
        public virtual ICollection<Project> Projects{get;set;}
        public virtual Membership Membership { get; set; }
        #endregion

        public virtual void AddRoles(ICollection<Role> roles)
        {
            if (this.Roles == null)
            {
                this.Roles = new List<Role>();
            }
            foreach (var role in roles)
                this.Roles.Add(role);
        }

        public virtual void AddRole(Role role)
        {
            if (this.Roles == null)
            {
                this.Roles = new List<Role>();
            }
            this.Roles.Add(role);
        }

        public virtual void AddProject(Project project)
        {
            if (this.Projects == null)
                this.Projects = new List<Project>();
            this.Projects.Add(project);
        }
    }
}
